# In Memory Store

This example demonstrates how to setup chat history storage using the `InMemoryStore` KV store integration.

## Usage

The `InMemoryStore` allows for a generic type to be assigned to the values in the store.
We'll assign type `BaseMessage` as the type of our values, keeping with the theme of a chat history store.

import CodeBlock from "@theme/CodeBlock";
import Example from "@examples/stores/in_memory_storage.ts";

<CodeBlock language="typescript">{Example}</CodeBlock>
